﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Excel = Microsoft.Office.Interop.Excel;
using Office = Microsoft.Office.Core;
using Microsoft.Office.Tools.Excel;
using Microsoft.Office.Tools;
using CrmCustomizationsExcelAddIn.Helper;
using CrmCustomizationsExcelAddIn.Data;

namespace CrmCustomizationsExcelAddIn
{
    public partial class CrmAddIn
    {

        private CustomTaskPane taskPane;
        internal CustomTaskPane TaskPane
        {
            get
            {
                return this.taskPane;
            }
        }

        private CrmOperationHelper _crmOpHelper;

        internal CrmOperationHelper crmOpHelper
        {
            get { return _crmOpHelper; }
            set { _crmOpHelper = value; }
        }

        private ExcelDataAccess _excelHelper;

        public ExcelDataAccess excelHelper
        {
            get { return _excelHelper; }
            set { _excelHelper = value; }
        }


        private void CrmAddIn_Startup(object sender, System.EventArgs e)
        {
            crmOpHelper = new CrmOperationHelper();
            ActionPanelEntityList taskPaneControl = new ActionPanelEntityList();
            this.taskPane = this.CustomTaskPanes.Add(taskPaneControl, "CRM Entities List");
            this.taskPane.Width = 300;
            this.taskPane.Visible = false;
            excelHelper = new ExcelDataAccess(Globals.CrmAddIn.Application,GlobalApplicationData.Instance);
        }

        private void CrmAddIn_Shutdown(object sender, System.EventArgs e)
        {
        }

        #region VSTO generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(CrmAddIn_Startup);
            this.Shutdown += new System.EventHandler(CrmAddIn_Shutdown);
        }
        
        #endregion
    }
}
